	package com.kingdee.eas.custom.invest.client;

	public class SqlString {
		
		public static String getJJXMSQL(String asql,String auditState){
			 String sql = " SELECT YEARINVESTREPORT.FID , PROJECTENTRY.FID , PROJECTENTRY.CFProjectPlanTypeI ,YEARINVESTREPORT.FYearID , " +
			 				"GKUnitTree.FName_l2 , YEAR.FName_l2 , "+
								" PROJECTENTRY.CFIsSelect , PROJECTENTRY.CFAuditState , PROJECTTYP.FName_l2 , " +
								" PROJECTENTRY.CFProject , BUILDCHARACTER.FName_l2, PROJECTENTRY.CFBuildScope , " +
								" PROJECTENTRY.CFBuildStartDate , PROJECTENTRY.CFBuildFinishDate , PROJECTENTRY.CFTotalInvest , "+ 
								" FUNDSOURCE.FName_l2 , PROJECTENTRY.CFAddLastInvest , PROJECTENTRY.CFYearInvest , " +
								" PROJECTENTRY.CFAdjustAmount , PROJECTENTRY.CFBuildContent , PROJECTENTRY.CFBeizhu  "+
								" FROM T_AUD_YearInvestReport  YEARINVESTREPORT " +
								
								" RIGHT OUTER JOIN CT_AUD_YearIRBJSE  PROJECTENTRY " +
								" ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID " +
								
								" LEFT OUTER JOIN T_BAS_Year  YEAR "+
								" ON YEARINVESTREPORT.FYearID = YEAR.FID " +
								
								" LEFT OUTER JOIN T_BAS_GKUnit  SCHEMEUNIT2 "+
								" ON PROJECTENTRY.CFSchemeUnit2ID = SCHEMEUNIT2.FID  "+
								
								" LEFT OUTER JOIN CT_AUD_ProjectPlanGroop  PROJECTPLANTYPE "+
								" ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
								
								" LEFT OUTER JOIN T_BAS_FundOrigin  FUNDSOURCE "+
								" ON PROJECTENTRY.CFFundSourceID = FUNDSOURCE.FID "+
						
								" LEFT OUTER JOIN T_BAS_ProjectCharacter  BUILDCHARACTER "+
								" ON PROJECTENTRY.CFBuildCharacterID = BUILDCHARACTER.FID "+
						
								" LEFT OUTER JOIN T_BAS_ProjectManager  PROJECTNAME "+
								" ON PROJECTENTRY.CFProjectNameID = PROJECTNAME.FID "+
						
								" LEFT OUTER JOIN T_BAS_GKUnit  REPORTUNIT2 "+
								" ON PROJECTENTRY.CFReportUnit2ID = REPORTUNIT2.FID "+
						
								" LEFT OUTER JOIN T_BAS_ProjectManager  PROJECTTYP "+
								" ON PROJECTENTRY.CFProjectTypID = PROJECTTYP.FID "+
						
								" RIGHT OUTER JOIN T_AUD_YearInvestReport  PARENT "+
								" ON PROJECTENTRY.FParentID = PARENT.FID "+
						
								" LEFT OUTER JOIN T_BAS_GKUnitTREE  GKUnitTree "+
								" ON SCHEMEUNIT2.FTREEID = GKUnitTree.FID "+
						
								" WHERE PROJECTENTRY.CFProject <> '\"\"' AND PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
								asql+
						
								" ORDER BY  "+
								" YEAR.FName_l2 ASC, "+
								" GKUnitTree.FName_l2 ASC";
			return sql;
		}
		
		public static String getJGXMSQL(String asql,String auditState){
			String sql = " SELECT "+
						"YEARINVESTREPORT.FID ,  "+
						"PROJECTENTRY.FID ,  "+
						"PROJECTENTRY.CFProjectPlanTypeI  ,  "+
						"YEARINVESTREPORT.FYearID  ,  "+
						"GKUnitTree.FName_l2  ,  "+
						"YEAR.FName_l2 ,  "+
						"PROJECTENTRY.CFIsSelect,  "+
						"PROJECTENTRY.CFAuditState ,  "+
						"PROJECTTYP.FName_l2 ,  "+
						"PROJECTENTRY.CFProject ,  "+
						"BUILDCHARACTER.FName_l2 ,  "+
						"PROJECTENTRY.CFBuildScope ,  "+
						"PROJECTENTRY.CFBuildStartDate ,  "+
						"PROJECTENTRY.CFBuildFinishDate ,  "+
						"PROJECTENTRY.CFTotalInvest ,  "+
						"FUNDSOURCE.FName_l2 ,  "+
						"PROJECTENTRY.CFAddLastInvest , "+ 
						"PROJECTENTRY.CFYearInvest ,  "+
						"PROJECTENTRY.CFAdjustAmount ,  "+
						"PROJECTENTRY.CFBuildContent ,  "+
						"PROJECTENTRY.CFBeizhu  "+
						
						"FROM T_AUD_YearInvestReport YEARINVESTREPORT  "+
						
						"RIGHT OUTER JOIN CT_AUD_YearIRCSE PROJECTENTRY "+
						"ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID "+
						
						"LEFT OUTER JOIN T_BAS_Year YEAR "+
						"ON YEARINVESTREPORT.FYearID = YEAR.FID "+
						
					    "LEFT OUTER JOIN T_BAS_GKUnit SCHEMEUNIT2 "+
						"ON PROJECTENTRY.CFSchemeUnit2ID = SCHEMEUNIT2.FID "+
						
						"LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
						"ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
						
						"LEFT OUTER JOIN T_BAS_FundOrigin FUNDSOURCE "+
						"ON PROJECTENTRY.CFFundSourceID = FUNDSOURCE.FID "+
						
						"LEFT OUTER JOIN T_BAS_ProjectCharacter BUILDCHARACTER "+
						"ON PROJECTENTRY.CFBuildCharacterID = BUILDCHARACTER.FID "+
						
						"LEFT OUTER JOIN T_BAS_ProjectManager PROJECTNAME "+
						"ON PROJECTENTRY.CFProjectNameID = PROJECTNAME.FID "+
						
						"LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT2 "+
						"ON PROJECTENTRY.CFReportUnit2ID = REPORTUNIT2.FID "+
						
						"LEFT OUTER JOIN T_BAS_ProjectManager PROJECTTYP "+
						"ON PROJECTENTRY.CFProjectTypID = PROJECTTYP.FID "+
						
						"RIGHT OUTER JOIN T_AUD_YearInvestReport PARENT "+
						"ON PROJECTENTRY.FParentID = PARENT.FID "+
						
						"LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree "+
						"ON SCHEMEUNIT2.FTREEID = GKUnitTree.FID "+
			
						" WHERE PROJECTENTRY.CFProject <> '\"\"' AND PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
						asql+
						
						" ORDER BY  "+
						" YEAR.FName_l2 ASC, "+
						" GKUnitTree.FName_l2 ASC";
						return sql;
		}
		public static String getSXXMSQL(String asql,String auditState){
			String sql = "  SELECT "+

						"   YEARINVESTREPORT.FID , "+
						" 	PROJECTENTRY.FID , "+
						" 	PROJECTENTRY.CFProjectPlanTypeI , "+
						" 	YEARINVESTREPORT.FYearID , "+
						" 	GKUnitTree.FName_l2 , "+
						" 	YEAR.FName_l2 , "+
						" 	PROJECTENTRY.CFIsSelect , "+
						" 	PROJECTENTRY.CFAuditState , "+
						" 	PROJECTTYP.FName_l2 , "+
						" 	PROJECTENTRY.CFProject , "+
						" 	BUILDCHARACTER.FName_l2 , "+
						" 	PROJECTENTRY.CFBuildScope , "+
						" 	PROJECTENTRY.CFBuildStartDate , "+
						" 	PROJECTENTRY.CFBuildFinishDate , "+
						" 	PROJECTENTRY.CFTotalInvest , "+
						" 	FUNDSOURCE.FName_l2 , "+
						" 	PROJECTENTRY.CFAddLastInvest , "+
						" 	PROJECTENTRY.CFYearInvest , "+
						" 	PROJECTENTRY.CFAdjustAmount , "+
						"   PROJECTENTRY.CFBuildContent , "+
						"  	PROJECTENTRY.CFBeizhu "+
								
						" 	FROM T_AUD_YearInvestReport  YEARINVESTREPORT"+
								
						" 	RIGHT OUTER JOIN CT_AUD_YearIRJCSE PROJECTENTRY"+
						" 	ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID"+
								
						" 	LEFT OUTER JOIN T_BAS_Year YEAR"+
						" 	ON YEARINVESTREPORT.FYearID = YEAR.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_GKUnit SCHEMEUNIT2"+
						" 	ON PROJECTENTRY.CFSchemeUnit2ID = SCHEMEUNIT2.FID"+
								
						" 	LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE"+
						" 	ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_FundOrigin FUNDSOURCE"+
						" 	ON PROJECTENTRY.CFFundSourceID = FUNDSOURCE.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_ProjectCharacter BUILDCHARACTER"+
						" 	ON PROJECTENTRY.CFBuildCharacterID = BUILDCHARACTER.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_ProjectManager PROJECTNAME"+
						" 	ON PROJECTENTRY.CFProjectNameID = PROJECTNAME.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT2"+
						" 	ON PROJECTENTRY.CFReportUnit2ID = REPORTUNIT2.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_ProjectManager PROJECTTYP"+
						" 	ON PROJECTENTRY.CFProjectTypID = PROJECTTYP.FID"+
								
						" 	RIGHT OUTER JOIN T_AUD_YearInvestReport PARENT"+
						" 	ON PROJECTENTRY.FParentID = PARENT.FID"+
								
						" 	LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree"+
						" 	ON SCHEMEUNIT2.FTREEID = GKUnitTree.FID"+
											
						" WHERE PROJECTENTRY.CFProject <> '\"\"' AND PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
						asql+
					
						" ORDER BY  "+
						" YEAR.FName_l2 ASC, "+
						" GKUnitTree.FName_l2 ASC";
						return sql;
		}
		public static String getOtherSQL(String asql,String auditState){
			String sql = " SELECT "+
				" 		YEARINVESTREPORT.FID , "+ 
				" 		PROJECTENTRY.FID ,  "+
				" 		PROJECTENTRY.CFProjectPlanTypeI ,  "+
				" 		YEARINVESTREPORT.FYearID ,  "+
				" 		GKUnitTree.FName_l2  ,  "+
				" 		YEAR.FName_l2  ,  "+
				" 		PROJECTENTRY.CFIsSelect ,  "+
				" 		PROJECTENTRY.CFAuditState,  "+
				" 		PROJECTTYP.FName_l2 ,  "+
				" 		PROJECTENTRY.CFProject ,  "+
				" 		BUILDCHARACTER.FName_l2 ,  "+
				" 		PROJECTENTRY.CFBuildScope ,  "+
				" 		PROJECTENTRY.CFBuildStartDate ,  "+
				" 		PROJECTENTRY.CFBuildFinishDate ,  "+
				" 		PROJECTENTRY.CFTotalInvest ,  "+
				" 		FUNDSOURCE.FName_l2 ,  "+
				" 		PROJECTENTRY.CFAddLastInvest ,  "+
				" 		PROJECTENTRY.CFYearInvest ,  "+
				" 		PROJECTENTRY.CFAdjustAmount,  "+
				" 		PROJECTENTRY.CFBuildContent ,  "+
				" 		PROJECTENTRY.CFBeizhu  "+
							
				" 		FROM T_AUD_YearInvestReport YEARINVESTREPORT "+
							
				" 		RIGHT OUTER JOIN CT_AUD_YearIROSE PROJECTENTRY "+
				" 		ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID "+
							
				" 		LEFT OUTER JOIN T_BAS_Year YEAR "+
				" 		ON YEARINVESTREPORT.FYearID = YEAR.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_GKUnit SCHEMEUNIT2 "+
				" 		ON PROJECTENTRY.CFSchemeUnit2ID = SCHEMEUNIT2.FID "+
							
				" 		LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
				" 		ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_FundOrigin FUNDSOURCE "+
				" 		ON PROJECTENTRY.CFFundSourceID = FUNDSOURCE.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_ProjectCharacter BUILDCHARACTER "+
				" 		ON PROJECTENTRY.CFBuildCharacterID = BUILDCHARACTER.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_ProjectManager PROJECTNAME "+
				" 		ON PROJECTENTRY.CFProjectNameID = PROJECTNAME.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT2 "+
				" 		ON PROJECTENTRY.CFReportUnit2ID = REPORTUNIT2.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_ProjectManager PROJECTTYP "+
				" 		ON PROJECTENTRY.CFProjectTypID = PROJECTTYP.FID "+
							
				" 		RIGHT OUTER JOIN T_AUD_YearInvestReport PARENT "+
				" 		ON PROJECTENTRY.FParentID = PARENT.FID "+
							
				" 		LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree "+
				" 		ON SCHEMEUNIT2.FTREEID = GKUnitTree.FID "+
						
						" WHERE PROJECTENTRY.CFProject <> '\"\"' AND PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
						asql+
						
						" ORDER BY  "+
						" YEAR.FName_l2 ASC, "+
						" GKUnitTree.FName_l2 ASC";
						return sql;
		}
		public static String getSBSQL(String asql,String auditState){
			String sql = " SELECT  "+
				 " PROJECTENTRY.FParentID ,  "+
				 " 	YEARINVESTREPORT.FID ,  "+
				 " 	PROJECTENTRY.CFProjectPlanTypeI ,  "+
				 " 	YEARINVESTREPORT.FYearID ,  "+
				 " 	GKUNITTREE.FName_l2 ,  "+
				 " 	YEAR.FName_l2 ,  "+
				 " 	PROJECTENTRY.CFIsSelect ,   "+ 
				 " 	PROJECTENTRY.CFAuditState ,  "+
				 " 	INVESTDESCRIPT.FName_l2 ,  "+
				 " 	PROJECTENTRY.FAssetName ,  "+
				 "  PROJECTENTRY.FModel ,  "+
				 " 	CHARACTER.FName_l2 ,  "+
				 " 	UNIT.FName_l2 ,  "+
				 " 	PROJECTENTRY.FAmount ,  "+
				 " 	PROJECTENTRY.FPlanInvest ,  "+
				 " 	PROJECTENTRY.CFAdjustAmount ,  "+
				 " 	FUNDSOURCE.FName_l2 ,  "+
				 " 	REPORTUNIT2.FName_l2 ,  "+
				 " 	SCHEMEUNIT2.FName_l2 ,  "+
				 " 	PROJECTENTRY.FBIMUDF0001  "+
				 	
				 " FROM T_AUD_YearInvestReportEntry PROJECTENTRY "+
				 	
				 " 	LEFT OUTER JOIN T_BAS_GKUnit SCHEMEUNIT2 "+
				 " 	ON PROJECTENTRY.FSchemeUnit2ID = SCHEMEUNIT2.FID "+
						
				 " 	LEFT OUTER JOIN T_BAS_FundOrigin FUNDSOURCE "+
				 " 	ON PROJECTENTRY.FFundSourceID = FUNDSOURCE.FID "+
						
				 " 	LEFT OUTER JOIN CT_BAS_Unit UNIT "+
				 " 	ON PROJECTENTRY.CFUnitID = UNIT.FID "+
						
				 " 	LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
				 " 	ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+ 
						
				 " 	LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT2 "+
				 " 	ON PROJECTENTRY.FReportUnit2ID = REPORTUNIT2.FID "+
						
				 " 	LEFT OUTER JOIN T_BAS_AssetCharacter CHARACTER "+
				 " 	ON PROJECTENTRY.FCharacterID = CHARACTER.FID "+
						
				 " 	LEFT OUTER JOIN T_BAS_InvestDirection INVESTDESCRIPT "+
				 " 	ON PROJECTENTRY.FInvestDescriptID = INVESTDESCRIPT.FID "+
						
				 " 	LEFT OUTER JOIN T_AUD_YearInvestReport YEARINVESTREPORT "+
				 " 	ON PROJECTENTRY.FParentID = YEARINVESTREPORT.FID "+
				 
				 " 	LEFT OUTER JOIN T_BAS_GKUnitTREE GKUNITTREE "+
				 " 	ON REPORTUNIT2.FTREEID = GKUNITTREE.FID "+
						
				 " 	LEFT OUTER JOIN T_BAS_Year YEAR "+
				 " 	ON YEARINVESTREPORT.FYearID = YEAR.FID "+
			
				 " WHERE PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
				 asql+
			
				 " ORDER BY  "+
				 " YEAR.FName_l2 ASC, "+
				 " GKUnitTree.FName_l2 ASC";
				return sql;
		}
		public static String getTJSQL(String asql,String auditState){
			String sql = "  SELECT  "+
				"   	YEARINVESTREPORT.FID ,  "+
				"  	    PROJECTENTRY.FID ,  "+
				" 		PROJECTENTRY.CFProjectPlanTypeI ,  "+
				" 		YEARINVESTREPORT.FYearID , "+ 
				" 		GKUnitTree.FName_l2 ,  "+
				" 		YEAR.FName_l2 ,  "+
				" 		PROJECTENTRY.CFIsSelect , "+ 
				" 		PROJECTENTRY.CFAuditState ,  "+
				" 		INVESTDESCRIPTION.FName_l2 ,  "+
				" 		PROJECTENTRY.CFProjectName ,  "+
				" 		PROJECTENTRY.CFInvestAmount ,  "+
				" 		PROJECTENTRY.CFAdjustAmount ,  "+
				" 		FUNDSOURCE.FName_l2 ,  "+
				" 		REPORTUNIT.FName_l2 ,  "+
				" 		SCHEMEUNIT.FName_l2 ,  "+
				" 		PROJECTENTRY.CFBeizhu  "+
						
				" 		FROM T_AUD_YearInvestReport YEARINVESTREPORT "+
						
				" 		RIGHT OUTER JOIN CT_AUD_YearInvestReportBuild PROJECTENTRY "+
				" 		ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID "+
						
				" 		LEFT OUTER JOIN T_BAS_Year YEAR "+
				" 		ON YEARINVESTREPORT.FYearID = YEAR.FID "+
						
				" 		LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT "+
				" 		ON PROJECTENTRY.CFReportUnitID = REPORTUNIT.FID "+
						
				" 		LEFT OUTER JOIN T_BAS_InvestDirection INVESTDESCRIPTION "+
				" 		ON PROJECTENTRY.CFInvestDescriptio = INVESTDESCRIPTION.FID "+
						
				" 		LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
				" 		ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
						
				" 		LEFT OUTER JOIN T_BAS_FundOrigin FUNDSOURCE "+
				" 		ON PROJECTENTRY.CFFundSourceID = FUNDSOURCE.FID "+
						
				" 		LEFT OUTER JOIN T_BAS_GKUnit SCHEMEUNIT "+
				" 		ON PROJECTENTRY.CFSchemeUnitID = SCHEMEUNIT.FID "+
						
				" 		LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree "+
				" 		ON REPORTUNIT.FTREEID = GKUnitTree.FID "+
					
					" WHERE PROJECTENTRY.CFProjectName <> '\"\"' AND PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
					asql+
					
					" ORDER BY  "+
					" YEAR.FName_l2 ASC, "+
					" GKUnitTree.FName_l2 ASC";
					return sql;
		}
		public static String getPCSQL(String asql,String auditState){
			String sql = " SELECT  "+
			 " 	    YEARINVESTREPORT.FID ,  "+
			 " 		PROJECTENTRY.FID ,  "+
			 " 		PROJECTENTRY.CFProjectPlanTypeI ,  "+
			 " 		YEARINVESTREPORT.FYearID ,  "+
			 " 		GKUnitTree.FName_l2  ,  "+
			 " 		YEAR.FName_l2 ,  "+
			 " 		PROJECTENTRY.CFIsSelect ,  "+
			 " 		PROJECTENTRY.CFAuditState ,  "+
			 " 		INVESTDESTINATION.FName_l2 ,  "+
			 " 		UNITNAME.FName_l2 ,  "+
			 " 		PROJECTENTRY.CFEquipmentName ,  "+
			 " 		PROJECTENTRY.CFModel ,  "+
			 " 		PROJECTENTRY.CFAmount ,  "+
			 " 		PROJECTENTRY.CFInvestAmount ,  "+
			 " 		PROJECTENTRY.CFAdjustAmount ,  "+
			 " 		PROJECTENTRY.CFBezhu  "+
						
			 " 		FROM T_AUD_YearInvestReport YEARINVESTREPORT "+
						
			 " 		RIGHT OUTER JOIN CT_AUD_YearInvestReportPcInfo PROJECTENTRY "+
			 " 		ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID "+
						
			 " 		LEFT OUTER JOIN T_BAS_Year YEAR "+
			 " 		ON YEARINVESTREPORT.FYearID = YEAR.FID "+
						
			 " 		LEFT OUTER JOIN T_BAS_InvestDirection INVESTDESTINATION "+
			 " 		ON PROJECTENTRY.CFInvestDestinatio = INVESTDESTINATION.FID "+
						
			 " 		LEFT OUTER JOIN CT_BAS_Unit UNIT "+
			 " 		ON PROJECTENTRY.CFUnitID = UNIT.FID "+
						
			 " 		LEFT OUTER JOIN T_BAS_GKUnit UNITNAME "+
			 " 		ON PROJECTENTRY.CFUnitNameID = UNITNAME.FID "+
						
			 " 		LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
			 " 		ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
						
			 " 		LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree "+
			 " 		ON UNITNAME.FTREEID = GKUnitTree.FID "+
		
			 " WHERE PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
			 asql+
		
			 " ORDER BY  "+
			 " YEAR.FName_l2 ASC, "+
			 " GKUnitTree.FName_l2 ASC";
			return sql;
		}
		public static String getSystemSQL(String asql,String auditState){
			String sql = " SELECT  "+
					" YEARINVESTREPORT.FID ,  "+
					" 	PROJECTENTRY.FID ,  "+
					" 	PROJECTENTRY.CFProjectPlanTypeI ,  "+
					" 	YEARINVESTREPORT.FYearID ,  "+
					" 	GKUnitTree.FName_l2 ,  "+
					" 	YEAR.FName_l2 ,  "+
					" 	PROJECTENTRY.CFSelect ,  "+
					" 	PROJECTENTRY.CFAuditState , "+ 
					" 	INVESTDESCRIPTION.FName_l2 , "+ 
					" 	PROJECTENTRY.CFSystemName ,  "+
					" 	SYSTEMTYPE.FName_l2 ,  "+
					" 	PROJECTENTRY.CFContent ,  "+
					" 	PROJECTENTRY.CFInvestAmount , "+ 
					" 	PROJECTENTRY.CFAdjustAmount ,  "+
					" 	REPORTUNIT.FName_l2 ,  "+
					"   PROJECTENTRY.CFBeizhu  "+
							
					" 	FROM T_AUD_YearInvestReport YEARINVESTREPORT "+
						
					" 	LEFT OUTER JOIN T_BAS_Year YEAR "+
					" 	ON YEARINVESTREPORT.FYearID = YEAR.FID "+
							
					" 	RIGHT OUTER JOIN CT_AUD_YearInvestReportSystem PROJECTENTRY "+
					" 	ON YEARINVESTREPORT.FID = PROJECTENTRY.FParentID "+
							
					" 	LEFT OUTER JOIN T_BAS_GKUnit REPORTUNIT "+
					" 	ON PROJECTENTRY.CFReportUnitID = REPORTUNIT.FID "+
							
					" 	LEFT OUTER JOIN T_BAS_InvestDirection INVESTDESCRIPTION "+
					" 	ON PROJECTENTRY.CFInvestDescriptio = INVESTDESCRIPTION.FID "+
							
					" 	LEFT OUTER JOIN T_BAS_InfoSystem SYSTEMTYPE "+
					" 	ON PROJECTENTRY.CFSystemTypeID = SYSTEMTYPE.FID "+
							
					" 	LEFT OUTER JOIN CT_AUD_ProjectPlanGroop PROJECTPLANTYPE "+
					" 	ON PROJECTENTRY.CFProjectPlanTypeI = PROJECTPLANTYPE.FID "+
							
					" 	LEFT OUTER JOIN T_BAS_GKUnitTREE GKUnitTree "+
					" 	ON REPORTUNIT.FTREEID = GKUnitTree.FID "+
				
					 " WHERE PROJECTENTRY.CFAuditState = '"+auditState+"' " + 
					 asql+
				
					 " ORDER BY  "+
					 " YEAR.FName_l2 ASC, "+
					 " GKUnitTree.FName_l2 ASC";
				return sql;
		}
		 
	}
